MODULE MESH_VARIABLES
 
! Data structure for mesh-dependent variables
 
USE PRECISION_PARAMETERS
USE TYPES
IMPLICIT NONE

CHARACTER(255), PARAMETER :: meshid='$Id: mesh.f90 6197 2010-05-11 13:20:05Z mcgratta $'
CHARACTER(255), PARAMETER :: meshrev='$Revision: 6197 $'
CHARACTER(255), PARAMETER :: meshdate='$Date: 2010-05-11 14:20:05 +0100 (Tue, 11 May 2010) $'
 
TYPE MESH_TYPE
 
   REAL(EB), POINTER, DIMENSION(:,:,:) :: &
            U,V,W,US,VS,WS,DDDT,D,DS,H,HS,KRES,FVX,FVY,FVZ,RHO,RHOS, &
            MU,TMP,Q,FRHO,KAPPA,QR,QR_W,UII,RSUM,D_LAGRANGIAN, &
            C_DYNSMAG,MTR,MSR,MU_DNS,WEM
 
   REAL(EB), POINTER, DIMENSION(:,:,:,:) :: YY,YYS,DEL_RHO_D_DEL_Y
   REAL(EB), POINTER, DIMENSION(:,:,:,:) :: AVG_DROP_DEN,AVG_DROP_TMP,AVG_DROP_RAD,AVG_DROP_AREA
   REAL(EB), POINTER, DIMENSION(:,:) :: UVW_GHOST
 
   REAL(EB) :: POIS_PTB,POIS_ERR
   REAL(EB), POINTER, DIMENSION(:) :: SAVE1,SAVE2,WORK
   REAL(EB), POINTER, DIMENSION(:,:,:) :: PRHS
   REAL(EB), POINTER, DIMENSION(:,:) :: BXS,BXF,BYS,BYF,BZS,BZF, BXST,BXFT,BYST,BYFT,BZST,BZFT
   INTEGER :: LSAVE,LWORK,LBC,MBC,NBC,ITRN,JTRN,KTRN,IPS
   REAL(EB), POINTER, DIMENSION(:) :: P_0,RHO_0,TMP_0,D_PBAR_DT,D_PBAR_S_DT,U_LEAK,U_DUCT
   REAL(EB), POINTER, DIMENSION(:,:) :: PBAR,PBAR_S,R_PBAR
   INTEGER, POINTER, DIMENSION(:,:,:) :: PRESSURE_ZONE 
   INTEGER, POINTER, DIMENSION(:) :: PRESSURE_ZONE_WALL,PRESSURE_BC_INDEX
   REAL(EB), POINTER, DIMENSION(:,:,:) :: WORK1,WORK2,WORK3,WORK4,WORK5,WORK6,WORK7
   
   REAL(EB), POINTER, DIMENSION(:,:,:) :: TURB_WORK1,TURB_WORK2,TURB_WORK3,TURB_WORK4
   REAL(EB), POINTER, DIMENSION(:,:,:) :: TURB_WORK5,TURB_WORK6,TURB_WORK7,TURB_WORK8
   REAL(EB), POINTER, DIMENSION(:,:,:) :: TURB_WORK9,TURB_WORK10
   REAL(EB), POINTER, DIMENSION(:) :: TURB_WORK11,TURB_WORK12

   COMPLEX(DPC), POINTER, DIMENSION(:,:,:) :: TURB_WORK_DPC1,TURB_WORK_DPC2,TURB_WORK_DPC3,TURB_WORK_DPC4
   
   REAL(EB), POINTER, DIMENSION(:,:,:,:) :: SCALAR_SAVE1,SCALAR_SAVE2,SCALAR_SAVE3,SCALAR_SAVE4,SCALAR_SAVE5
   
   REAL(EB), POINTER, DIMENSION(:,:,:) :: IBM_SAVE1,IBM_SAVE2,IBM_SAVE3,IBM_SAVE4,IBM_SAVE5,IBM_SAVE6
   
   REAL(EB), POINTER, DIMENSION(:) :: WALL_WORK1,WALL_WORK2
   REAL(FB), POINTER, DIMENSION(:,:,:,:) :: QQ
   REAL(FB), POINTER, DIMENSION(:,:) :: PP,PPN
   INTEGER, POINTER, DIMENSION(:,:) :: IBK
   INTEGER, POINTER, DIMENSION(:,:,:) :: IBLK
 
   REAL(EB) :: DT,DT_PREV,DT_NEXT,DT_INIT
   REAL(EB) :: CFL,DIVMX,DIVMN,VN,RESMAX,PART_CFL
   INTEGER  :: ICFL,JCFL,KCFL,IMX,JMX,KMX,IMN,JMN,KMN, I_VN,J_VN,K_VN,IRM,JRM,KRM
 
   INTEGER :: N_EDGES
   INTEGER, POINTER, DIMENSION(:,:) :: IJKE,EDGE_INDEX
   REAL(EB), POINTER, DIMENSION(:,:) :: TAU_E,OME_E
   INTEGER, POINTER, DIMENSION(:,:) :: EDGE_TYPE
   
   INTEGER :: MESH_LEVEL
   INTEGER :: IBAR,JBAR,KBAR,IBM1,JBM1,KBM1,IBP1,JBP1,KBP1
   INTEGER, POINTER, DIMENSION(:) :: RGB
   REAL(EB) :: DXI,DETA,DZETA,RDXI,RDETA,RDZETA, &
      DXMIN,DXMAX,DYMIN,DYMAX,DZMIN,DZMAX, &
      XS,XF,YS,YF,ZS,ZF,RDXINT,RDYINT,RDZINT,CELL_SIZE
   REAL(EB), POINTER, DIMENSION(:) :: R,RC,X,Y,Z,XC,YC,ZC,HX,HY,HZ, &
            DX,RDX,DXN,RDXN,DY,RDY,DYN,RDYN,DZ,RDZ,DZN,RDZN, &
            CELLSI,CELLSJ,CELLSK,RRN
   REAL(FB), POINTER, DIMENSION(:) :: XPLT,YPLT,ZPLT
 
   INTEGER :: N_OBST
   TYPE(OBSTRUCTION_TYPE), POINTER, DIMENSION(:) :: OBSTRUCTION
 
   INTEGER :: N_VENT
   TYPE(VENTS_TYPE), POINTER, DIMENSION(:) :: VENTS
 
   INTEGER, POINTER, DIMENSION(:,:,:) :: CELL_INDEX
   INTEGER, POINTER, DIMENSION(:) :: I_CELL,J_CELL,K_CELL,OBST_INDEX_C
   INTEGER, POINTER, DIMENSION(:,:) :: WALL_INDEX
   LOGICAL, POINTER, DIMENSION(:) :: SOLID,EXTERIOR
 
   INTEGER :: NWC,NEWC,NDWC,NVWC,CELL_COUNT,WALL_COUNTER
   REAL(EB) :: BC_CLOCK
   REAL(EB), POINTER, DIMENSION(:,:) :: MASSFLUX,MASSFLUX_ACTUAL,AWMPUA,WMPUA,WCPUA
   REAL(EB), POINTER, DIMENSION(:,:) :: RHODW,YY_F,EDGE_INTERPOLATION_FACTOR,FW
   REAL(EB), POINTER, DIMENSION(:)   :: XW,YW,ZW,TW,AW,RAW,UW0,DUWDT,RDN, &
            QRADIN,QRADOUT,EW,KW,QCONF,AREA_ADJUST,RHO_F, &
            TMP_F,TMP_B,HEAT_TRANS_COEF,D_CORR,DS_CORR,UVW_SAVE,AWMSOOT,U_TAU,DH,DHS
   REAL(EB), POINTER, DIMENSION(:) :: E_WALL
   REAL(EB), POINTER, DIMENSION(:) :: UW,UWS
   INTEGER, POINTER, DIMENSION(:,:) :: IJKW
   INTEGER, POINTER, DIMENSION(:) :: BOUNDARY_TYPE,NPPCW,OBST_INDEX_W,WALL_INDEX_BACK,VENT_INDEX,IBC_ORIG
 
   TYPE(WALL_TYPE), POINTER, DIMENSION(:) :: WALL
   TYPE(OMESH_TYPE), POINTER, DIMENSION(:) :: OMESH
   TYPE(DROPLET_TYPE), POINTER, DIMENSION(:) :: DROPLET
   INTEGER :: NLP,NLPDIM
   TYPE(HUMAN_TYPE), POINTER, DIMENSION(:) :: HUMAN
   INTEGER :: N_HUMANS,N_HUMANS_DIM
   TYPE(HUMAN_GRID_TYPE), POINTER, DIMENSION(:,:) :: HUMAN_GRID
 
   INTEGER :: N_SLCF
   TYPE(SLICE_TYPE), POINTER, DIMENSION(:) :: SLICE
 
   INTEGER, POINTER, DIMENSION(:,:) :: INC
   INTEGER :: NPATCH
 
   REAL(EB), POINTER, DIMENSION(:,:,:,:) :: UIID
   INTEGER :: RAD_CALL_COUNTER,ANGLE_INC_COUNTER
 
   INTEGER, POINTER, DIMENSION(:,:,:) :: INTERPOLATED_MESH
 
   CHARACTER(80), POINTER, DIMENSION(:) :: STRING
   INTEGER :: N_STRINGS,N_STRINGS_MAX

!rm ->
!  REAL(EB), POINTER, DIMENSION(:,:,:,:) :: DMPVDT_FM_VEG
   INTEGER, POINTER, DIMENSION(:,:,:) :: K_AGL_SLICE
   REAL(EB),POINTER, DIMENSION(:,:) :: LS_Z_TERRAIN,VEG_DRAG
   INTEGER :: N_TERRAIN_SLCF
   REAL(EB) :: VEG_CLOCK_BC !surf veg
!rm <-
 
END TYPE MESH_TYPE
 
TYPE (MESH_TYPE), SAVE, DIMENSION(:), ALLOCATABLE, TARGET :: MESHES
 
END MODULE MESH_VARIABLES
 
 
MODULE MESH_POINTERS
 
USE PRECISION_PARAMETERS
USE MESH_VARIABLES
USE GLOBAL_CONSTANTS, ONLY: PERIODIC_TEST,DYNSMAG,FLUX_LIMITER,CHECK_KINETIC_ENERGY,IMMERSED_BOUNDARY_METHOD
IMPLICIT NONE
 
REAL(EB), POINTER, DIMENSION(:,:,:) :: &
          U,V,W,US,VS,WS,DDDT,D,DS,H,HS,KRES,FVX,FVY,FVZ,RHO,RHOS, &
          MU,TMP,Q,FRHO,KAPPA,QR,QR_W,UII,RSUM,D_LAGRANGIAN, &
          C_DYNSMAG,MTR,MSR,MU_DNS,WEM
REAL(EB), POINTER, DIMENSION(:,:,:,:) :: YY,YYS,DEL_RHO_D_DEL_Y
REAL(EB), POINTER, DIMENSION(:,:,:,:) :: AVG_DROP_DEN,AVG_DROP_TMP,AVG_DROP_RAD,AVG_DROP_AREA
REAL(EB), POINTER, DIMENSION(:,:) :: UVW_GHOST
REAL(EB), POINTER :: POIS_PTB,POIS_ERR
REAL(EB), POINTER, DIMENSION(:) :: SAVE1,SAVE2,WORK
REAL(EB), POINTER, DIMENSION(:,:,:) :: PRHS
REAL(EB), POINTER, DIMENSION(:,:) :: BXS,BXF,BYS,BYF,BZS,BZF, BXST,BXFT,BYST,BYFT,BZST,BZFT
INTEGER, POINTER :: LSAVE,LWORK,LBC,MBC,NBC,ITRN,JTRN,KTRN,IPS
REAL(EB), POINTER, DIMENSION(:) :: P_0,RHO_0,TMP_0,D_PBAR_DT,D_PBAR_S_DT,U_LEAK,U_DUCT
REAL(EB), POINTER, DIMENSION(:,:) :: PBAR,PBAR_S,R_PBAR
INTEGER, POINTER, DIMENSION(:,:,:) :: PRESSURE_ZONE
INTEGER, POINTER, DIMENSION(:) :: PRESSURE_ZONE_WALL,PRESSURE_BC_INDEX
REAL(EB), POINTER, DIMENSION(:,:,:) :: WORK1,WORK2,WORK3,WORK4,WORK5,WORK6,WORK7

REAL(EB), POINTER, DIMENSION(:,:,:) :: TURB_WORK1,TURB_WORK2,TURB_WORK3,TURB_WORK4
REAL(EB), POINTER, DIMENSION(:,:,:) :: TURB_WORK5,TURB_WORK6,TURB_WORK7,TURB_WORK8
REAL(EB), POINTER, DIMENSION(:,:,:) :: TURB_WORK9,TURB_WORK10
REAL(EB), POINTER, DIMENSION(:) :: TURB_WORK11,TURB_WORK12

COMPLEX(DPC), POINTER, DIMENSION(:,:,:) :: TURB_WORK_DPC1,TURB_WORK_DPC2,TURB_WORK_DPC3,TURB_WORK_DPC4

REAL(EB), POINTER, DIMENSION(:,:,:,:) :: SCALAR_SAVE1,SCALAR_SAVE2,SCALAR_SAVE3,SCALAR_SAVE4,SCALAR_SAVE5

REAL(EB), POINTER, DIMENSION(:,:,:) :: IBM_SAVE1,IBM_SAVE2,IBM_SAVE3,IBM_SAVE4,IBM_SAVE5,IBM_SAVE6

REAL(EB), POINTER, DIMENSION(:) :: WALL_WORK1,WALL_WORK2
REAL(FB), POINTER, DIMENSION(:,:,:,:) :: QQ
REAL(FB), POINTER, DIMENSION(:,:) :: PP,PPN
INTEGER, POINTER, DIMENSION(:,:) :: IBK
INTEGER, POINTER, DIMENSION(:,:,:) :: IBLK
REAL(EB), POINTER :: DT,DT_PREV,DT_NEXT,DT_INIT
REAL(EB), POINTER :: CFL,DIVMX,DIVMN,VN,RESMAX,PART_CFL
INTEGER, POINTER :: ICFL,JCFL,KCFL,IMX,JMX,KMX,IMN,JMN,KMN,I_VN,J_VN,K_VN,IRM,JRM,KRM
INTEGER, POINTER :: N_EDGES
INTEGER, POINTER, DIMENSION(:,:) :: IJKE,EDGE_INDEX
REAL(EB), POINTER, DIMENSION(:,:) :: TAU_E,OME_E
INTEGER, POINTER, DIMENSION(:,:) :: EDGE_TYPE

INTEGER, POINTER :: MESH_LEVEL
INTEGER, POINTER :: IBAR,JBAR,KBAR,IBM1,JBM1,KBM1,IBP1,JBP1,KBP1
INTEGER, POINTER, DIMENSION(:) :: RGB
REAL(EB), POINTER :: DXI,DETA,DZETA,RDXI,RDETA,RDZETA, &
   DXMIN,DXMAX,DYMIN,DYMAX,DZMIN,DZMAX, &
   XS,XF,YS,YF,ZS,ZF,RDXINT,RDYINT,RDZINT,CELL_SIZE
REAL(EB), POINTER, DIMENSION(:) :: R,RC,X,Y,Z,XC,YC,ZC,HX,HY,HZ, &
           DX,RDX,DXN,RDXN,DY,RDY,DYN,RDYN,DZ,RDZ,DZN,RDZN, &
           CELLSI,CELLSJ,CELLSK,RRN
REAL(FB), POINTER, DIMENSION(:) :: XPLT,YPLT,ZPLT
INTEGER, POINTER :: N_OBST
TYPE(OBSTRUCTION_TYPE), POINTER, DIMENSION(:) :: OBSTRUCTION
INTEGER, POINTER :: N_VENT
TYPE(VENTS_TYPE), POINTER, DIMENSION(:) :: VENTS
INTEGER, POINTER, DIMENSION(:,:,:) :: CELL_INDEX
INTEGER, POINTER, DIMENSION(:) :: I_CELL,J_CELL,K_CELL,OBST_INDEX_C
INTEGER, POINTER, DIMENSION(:,:) :: WALL_INDEX
LOGICAL, POINTER, DIMENSION(:) :: SOLID,EXTERIOR
INTEGER, POINTER :: NWC,NEWC,NDWC,NVWC,CELL_COUNT,WALL_COUNTER
REAL(EB),POINTER :: BC_CLOCK
REAL(EB), POINTER, DIMENSION(:,:) :: MASSFLUX,MASSFLUX_ACTUAL,AWMPUA,WMPUA,WCPUA
REAL(EB), POINTER, DIMENSION(:,:) :: RHODW,YY_F,EDGE_INTERPOLATION_FACTOR,FW
REAL(EB), POINTER, DIMENSION(:)   :: XW,YW,ZW,TW,AW,RAW,UW0,DUWDT,RDN, &
           QRADIN,QRADOUT,EW,KW,QCONF,AREA_ADJUST,RHO_F, &
           TMP_F,TMP_B,HEAT_TRANS_COEF,D_CORR,DS_CORR,UVW_SAVE,AWMSOOT,U_TAU,DH,DHS
REAL(EB), POINTER, DIMENSION(:) :: E_WALL
REAL(EB), POINTER, DIMENSION(:) :: UW,UWS
INTEGER, POINTER, DIMENSION(:,:) :: IJKW
INTEGER, POINTER, DIMENSION(:) :: BOUNDARY_TYPE,NPPCW,OBST_INDEX_W,WALL_INDEX_BACK,VENT_INDEX,IBC_ORIG
TYPE(WALL_TYPE), POINTER, DIMENSION(:) :: WALL
TYPE(OMESH_TYPE), POINTER, DIMENSION(:) :: OMESH
TYPE(DROPLET_TYPE), POINTER, DIMENSION(:) :: DROPLET
INTEGER, POINTER :: NLP,NLPDIM
TYPE(HUMAN_TYPE), POINTER, DIMENSION(:) :: HUMAN
INTEGER, POINTER :: N_HUMANS,N_HUMANS_DIM
TYPE(HUMAN_GRID_TYPE), POINTER, DIMENSION(:,:) :: HUMAN_GRID
INTEGER, POINTER :: N_SLCF
TYPE(SLICE_TYPE), POINTER, DIMENSION(:) :: SLICE
INTEGER, POINTER, DIMENSION(:,:) :: INC
INTEGER, POINTER :: NPATCH
REAL(EB), POINTER, DIMENSION(:,:,:,:) :: UIID
INTEGER,  POINTER :: RAD_CALL_COUNTER,ANGLE_INC_COUNTER
INTEGER, POINTER, DIMENSION(:,:,:) :: INTERPOLATED_MESH
CHARACTER(80), POINTER, DIMENSION(:) :: STRING
INTEGER, POINTER :: N_STRINGS,N_STRINGS_MAX
!rm ->
!REAL(EB), POINTER, DIMENSION(:,:,:,:) :: DMPVDT_FM_VEG
INTEGER, POINTER, DIMENSION(:,:,:) :: K_AGL_SLICE
REAL(EB), POINTER,DIMENSION(:,:) :: LS_Z_TERRAIN,VEG_DRAG
INTEGER, POINTER :: N_TERRAIN_SLCF
REAL(EB), POINTER :: VEG_CLOCK_BC  !surf veg
!rm <-

CONTAINS
 
 
SUBROUTINE POINT_TO_MESH(NM)

! Local names for MESH variables point to Global names
 
INTEGER, INTENT(IN) ::  NM
TYPE (MESH_TYPE), POINTER :: M
 
M=>MESHES(NM)
U=>M%U
V=>M%V
W=>M%W
US=>M%US
VS=>M%VS
WS=>M%WS
DDDT=>M%DDDT
D=>M%D
DS=>M%DS
H=>M%H 
HS=>M%HS
KRES=>M%KRES
FVX=>M%FVX
FVY=>M%FVY
FVZ=>M%FVZ  
RHO=>M%RHO
RHOS=>M%RHOS
TMP=>M%TMP
FRHO=>M%F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PERIODIC_TEST==2 .OR. DYNSMAG) THEN
   TURB_WORK1=>M%TURB_WORK1
   TURB_WORK2=>M%TURB_WORK2
   TURB_WORK3=>M%TURB_WORK3 
   TURB_WORK4=>M%TURB_WORK4
ENDIF

IF (DYNSMAG) THEN
   C_DYNSMAG =>M%C_DYNSMAG
 
   TURB_WORK5=>M%TURB_WORK5
   TURB_WORK6=>M%TURB_WORK6
   TURB_WORK7=>M%TURB_WORK7
   TURB_WORK8=>M%TURB_WORK8
   TURB_WORK9=>M%TURB_WORK9
   TURB_WORK10=>M%TURB_WORK10
ENDIF
   
IF (DYNSMAG .OR. CHECK_KINETIC_ENERGY) THEN
   TURB_WORK11=>M%TURB_WORK11
   TURB_WORK12=>M%TURB_WORK12
ENDIF

IF (PERIODIC_TEST==2) THEN
   TURB_WORK_DPC1=>M%TURB_WORK_DPC1
   TURB_WORK_DPC2=>M%TURB_WORK_DPC2
   TURB_WORK_DPC3=>M%TURB_WORK_DPC3
   TURB_WORK_DPC4=>M%TURB_WORK_DPC4
ENDIF

IF (FLUX_LIMITER>=0) THEN
   SCALAR_SAVE1=>M%SCALAR_SAVE1
   SCALAR_SAVE2=>M%SCALAR_SAVE2
   SCALAR_SAVE3=>M%SCALAR_SAVE3
   SCALAR_SAVE4=>M%SCALAR_SAVE4
   SCALAR_SAVE5=>M%SCALAR_SAVE5
ENDIF

IF (IMMERSED_BOUNDARY_METHOD==2) THEN
   IBM_SAVE1=>M%IBM_SAVE1
   IBM_SAVE2=>M%IBM_SAVE2
   IBM_SAVE3=>M%IBM_SAVE3
   IBM_SAVE4=>M%IBM_SAVE4
   IBM_SAVE5=>M%IBM_SAVE5
   IBM_SAVE6=>M%IBM_SAVE6
ENDIF

MESH_LEVEL=>M%MESH_LEVEL

MTR=>M%MTR
MSR=>M%MSR
WEM=>M%WEM

WALL_WORK1=>M%WALL_WORK1
WALL_WORK2=>M%WALL_WORK2
QQ=>M%QQ
PP=>M%PP
PPN=>M%PPN
IBK=>M%IBK
IB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S
OBST_INDEX_W=>M%OBST_INDEX_W
VENT_INDEX=>M%VENT_INDEX
IBC_ORIG=>M%IBC_ORIG
IJKW=>M%IJKW
EDGE_INTERPOLATION_FACTOR=>M%EDGE_INTERPOLATION_FACTOR
BOUNDARY_TYPE=>M%BOUNDARY_TYPE
WALL_INDEX_BACK=>M%WALL_INDEX_BACK
NPPCW=>M%NPPCW
WALL=>M%WALL
OMESH=>M%OMESH
DROPLET =>M%DROPLET  
NLP=>M%NLP 
NLPDIM=>M%NLPDIM
HUMAN =>M%HUMAN  
N_HUMANS=>M%N_HUMANS  
N_HUMANS_DIM=>M%N_HUMANS_DIM
HUMAN_GRID =>M%HUMAN_GRID
N_SLCF=>M%N_SLCF
SLICE=>M%SLICE
INC=>M%INC
NPATCH=>M%NPATCH
UIID=>M%UIID 
RAD_CALL_COUNTER=>M%RAD_CALL_COUNTER
ANGLE_INC_COUNTER=>M%ANGLE_INC_COUNTER
INTERPOLATED_MESH => M%INTERPOLATED_MESH
STRING=>M%STRING 
N_STRINGS=>M%N_STRINGS 
N_STRINGS_MAX=>M%N_STRINGS_MAX
!rm ->
!DMPVDT_FM_VEG => M%DMPVDT_FM_VEG
K_AGL_SLICE   => M%K_AGL_SLICE
N_TERRAIN_SLCF=>M%N_TERRAIN_SLCF
VEG_CLOCK_BC  =>M%VEG_CLOCK_BC !surf veg
VEG_DRAG      =>M%VEG_DRAG !bndry fuel momentum drag
LS_Z_TERRAIN    =>M%LS_Z_TERRAIN !terrain height for level set fire spread
!rm <-
 
END SUBROUTINE POINT_TO_MESH

SUBROUTINE GET_REV_mesh(MODULE_REV,MODULE_DATE)
INTEGER,INTENT(INOUT) :: MODULE_REV
CHARACTER(255),INTENT(INOUT) :: MODULE_DATE

WRITE(MODULE_DATE,'(A)') meshrev(INDEX(meshrev,':')+1:LEN_TRIM(meshrev)-2)
READ (MODULE_DATE,'(I5)') MODULE_REV
WRITE(MODULE_DATE,'(A)') meshdate

END SUBROUTINE GET_REV_mesh

 
END MODULE MESH_POINTERS

